********************************************************************************
** 	TITLE:		meta_contact_networks                                         ** 	
**	AUTHOR:	    Philippe Mongrain                                             **
**	DATA:       Various election studies                                      **
**	DATE:		October 2022 					                              **	
**	VERSION:	Stata 16					                                  **
********************************************************************************

* Version control

version 16.0

* Open log file

capture log close
log using "meta_contact_networks", replace

* AUSTRIA 2013 (NATIONAL)

use "at2013_autnes_parmest_national.dta", clear

gen region_code = 1
gen election_year = 2013
gen study_code = "Austria, AUTNES 2013 (N)"
gen study_id = "at2013-AUTNES-N"

save "at2013_autnes_parmest_national_meta_F.dta", replace

* AUSTRIA 2017 (NATIONAL)

use "at2017_autnes_parmest_national_full.dta", clear

gen region_code = 1
gen election_year = 2017
gen study_code = "Austria, AUTNES 2017 (N)"
gen study_id = "at2017-AUTNES-N"

save "at2017_autnes_parmest_national_meta_F.dta", replace

* BADEN-WÜRTTEMBERG 2016 (REGIONAL)

use "bw2016_gles_parmest_regional.dta", clear

gen region_code = 2
gen election_year = 2016
gen study_code = "Germany, GLES-BW 2016 (R)"
gen study_id = "bw2016-GLES-R"

save "bw2016_gles_parmest_regional_meta_F.dta", replace

* BAVARIA 2013 (REGIONAL)

use "by2013_gles_parmest_regional.dta", clear

gen region_code = 3
gen election_year = 2013
gen study_code = "Germany, GLES-BY 2013 (R)"
gen study_id = "by2013-GLES-R"

save "by2013_gles_parmest_regional_meta_F.dta", replace

* BRANDENBURG 2014 (REGIONAL)

use "bb2014_gles_parmest_regional.dta", clear

gen region_code = 4
gen election_year = 2014
gen study_code = "Germany, GLES-BB 2014 (R)"
gen study_id = "bb2014-GLES-R"

save "bb2014_gles_parmest_regional_meta_F.dta", replace

* CANADA 1988 (NATIONAL)

use "ca1988_ces_parmest_national_full.dta", clear

gen region_code = 5
gen election_year = 1988
gen study_code = "Canada, CES 1988 (N)"
gen study_id = "ca1988-CES-N"

save "ca1988_ces_parmest_national_meta_F.dta", replace

* CANADA 1988 (DISTRICT)

use "ca1988_ces_parmest_district.dta", clear

gen region_code = 5
gen election_year = 1988
gen study_code = "Canada, CES 1988 (D)"
gen study_id = "ca1988-CES-D"

save "ca1988_ces_parmest_district_meta_F.dta", replace

* CANADA 1993 (NATIONAL)

use "ca1993_ces_parmest_national.dta", clear

gen region_code = 5
gen election_year = 1993
gen study_code = "Canada, CES 1993 (N)"
gen study_id = "ca1993-CES-N"

save "ca1993_ces_parmest_national_meta_F.dta", replace

* CANADA 1997 (NATIONAL)

use "ca1997_ces_parmest_national_full.dta", clear

gen region_code = 5
gen election_year = 1997
gen study_code = "Canada, CES 1997 (N)"
gen study_id = "ca1997-CES-N"

save "ca1997_ces_parmest_national_meta_F.dta", replace

* CANADA 2000 (DISTRICT)

use "ca2000_ces_parmest_district_full.dta", clear

gen region_code = 5
gen election_year = 2000
gen study_code = "Canada, CES 2000 (D)"
gen study_id = "ca2000-CES-D"

save "ca2000_ces_parmest_district_meta_F.dta", replace

* CANADA 2004 (NATIONAL)

use "ca2004_ces_parmest_national.dta", clear

gen region_code = 5
gen election_year = 2004
gen study_code = "Canada, CES 2004 (N)"
gen study_id = "ca2004-CES-N"

save "ca2004_ces_parmest_national_meta_F.dta", replace

* CANADA 2004 (DISTRICT)

use "ca2004_ces_parmest_district.dta", clear

gen region_code = 5
gen election_year = 2004
gen study_code = "Canada, CES 2004 (D)"
gen study_id = "ca2004-CES-D"

save "ca2004_ces_parmest_district_meta_F.dta", replace

* CANADA 2006 (NATIONAL)

use "ca2006_ces_parmest_national_full.dta", clear

gen region_code = 5
gen election_year = 2006
gen study_code = "Canada, CES 2006 (N)"
gen study_id = "ca2006-CES-N"

save "ca2006_ces_parmest_national_meta_F.dta", replace

* CANADA 2006 (DISTRICT)

use "ca2006_ces_parmest_district_full.dta", clear

gen region_code = 5
gen election_year = 2006
gen study_code = "Canada, CES 2006 (D)"
gen study_id = "ca2006-CES-D"

save "ca2006_ces_parmest_district_meta_F.dta", replace

* CANADA 2008 (NATIONAL)

use "ca2008_ces_parmest_national.dta", clear

gen region_code = 5
gen election_year = 2008
gen study_code = "Canada, CES 2008 (N)"
gen study_id = "ca2008-CES-N"

save "ca2008_ces_parmest_national_meta_F.dta", replace

* CANADA 2008 (DISTRICT)

use "ca2008_ces_parmest_district.dta", clear

gen region_code = 5
gen election_year = 2008
gen study_code = "Canada, CES 2008 (D)"
gen study_id = "ca2008-CES-D"

save "ca2008_ces_parmest_district_meta_F.dta", replace

* CANADA 2011 (NATIONAL)

use "ca2011_ces_parmest_national.dta", clear

gen region_code = 5
gen election_year = 2011
gen study_code = "Canada, CES 2011 (N)"
gen study_id = "ca2011-CES-N"

save "ca2011_ces_parmest_national_meta_F.dta", replace

* CANADA 2011 (DISTRICT)

use "ca2011_ces_parmest_district.dta", clear

gen region_code = 5
gen election_year = 2011
gen study_code = "Canada, CES 2011 (D)"
gen study_id = "ca2011-CES-D"

save "ca2011_ces_parmest_district_meta_F.dta", replace

* CANADA 2019 (NATIONAL #1)

use "ca2019_ces_parmest_mostseats.dta", clear

gen region_code = 5
gen election_year = 2019
gen study_code = "Canada, CES 2019 #1 (N)"
gen study_id = "ca2019-CES-N1"

save "ca2019_ces_parmest_mostseats_meta_F.dta", replace

* CANADA 2019 (NATIONAL #2)

use "ca2019_ces_parmest_majority.dta", clear

gen region_code = 5
gen election_year = 2019
gen study_code = "Canada, CES 2019 #2 (N)"
gen study_id = "ca2019-CES-N2"

save "ca2019_ces_parmest_majority_meta_F.dta", replace

* CANADA 2019 (DISTRICT)

use "ca2019_ces_parmest_district.dta", clear

gen region_code = 5
gen election_year = 2019
gen study_code = "Canada, CES 2019 (D)"
gen study_id = "ca2019-CES-D"

save "ca2019_ces_parmest_district_meta_F.dta", replace

* CANADA 2011 (NATIONAL)

use "ca2011_ipsos_parmest_national_full.dta", clear

gen region_code = 5
gen election_year = 2011
gen study_code = "Canada, Ipsos-CA 2011 (N)"
gen study_id = "ca2011-Ipsos-N"

save "ca2011_ipsos_parmest_national_meta_F.dta", replace

* CANADA 2011 (DISTRICT)

use "ca2011_ipsos_parmest_district_full.dta", clear

gen region_code = 5
gen election_year = 2011
gen study_code = "Canada, Ipsos-CA 2011 (D)"
gen study_id = "ca2011-Ipsos-D"

save "ca2011_ipsos_parmest_district_meta_F.dta", replace

* CANADA 2015 (NATIONAL)

use "ca2015_ipsos_parmest_national_full.dta", clear

gen region_code = 5
gen election_year = 2015
gen study_code = "Canada, Ipsos-CA 2015 (N)"
gen study_id = "ca2015-Ipsos-N"

save "ca2015_ipsos_parmest_national_meta_F.dta", replace

* CANADA 2015 (DISTRICT)

use "ca2015_ipsos_parmest_district_full.dta", clear

gen region_code = 5
gen election_year = 2015
gen study_code = "Canada, Ipsos-CA 2015 (D)"
gen study_id = "ca2015-Ipsos-D"

save "ca2015_ipsos_parmest_district_meta_F.dta", replace

* GERMANY 2002 (NATIONAL)

use "de2002_gfes_parmest_national.dta", clear

gen region_code = 6
gen election_year = 2002
gen study_code = "Germany, GFES 2002 (N)"
gen study_id = "de2002-GFES-N"

save "de2002_gfes_parmest_national_meta_F.dta", replace

* GERMANY 2009 (NATIONAL)

use "de2009_gles_parmest_national.dta", clear

gen region_code = 6
gen election_year = 2009
gen study_code = "Germany, GLES-DE 2009 (N)"
gen study_id = "de2009-GLES-N"

save "de2009_gles_parmest_national_meta_F.dta", replace

* GERMANY 2009 (DISTRICT)

use "de2009_gles_parmest_district.dta", clear

gen region_code = 6
gen election_year = 2009
gen study_code = "Germany, GLES-DE 2009 (D)"
gen study_id = "de2009-GLES-D"

save "de2009_gles_parmest_district_meta_F.dta", replace

* GERMANY 2013 (NATIONAL)

use "de2013_gles_parmest_national.dta", clear

gen region_code = 6
gen election_year = 2013
gen study_code = "Germany, GLES-DE 2013 (N)"
gen study_id = "de2013-GLES-N"

save "de2013_gles_parmest_national_meta_F.dta", replace

* GERMANY 2013 (DISTRICT)

use "de2013_gles_parmest_district.dta", clear

gen region_code = 6
gen election_year = 2013
gen study_code = "Germany, GLES-DE 2013 (D)"
gen study_id = "de2013-GLES-D"

save "de2013_gles_parmest_district_meta_F.dta", replace

* GERMANY 2017 (NATIONAL)

use "de2017_gles_parmest_national.dta", clear

gen region_code = 6
gen election_year = 2017
gen study_code = "Germany, GLES-DE 2017 (N)"
gen study_id = "de2017-GLES-N"

save "de2017_gles_parmest_national_meta_F.dta", replace

* GERMANY 2017 (DISTRICT)

use "de2017_gles_parmest_district.dta", clear

gen region_code = 6
gen election_year = 2017
gen study_code = "Germany, GLES-DE 2017 (D)"
gen study_id = "de2017-GLES-D"

save "de2017_gles_parmest_district_meta_F.dta", replace

* GERMANY 2021 (NATIONAL)

use "de2021_gles_parmest_national.dta", clear

gen region_code = 6
gen election_year = 2021
gen study_code = "Germany, GLES-DE 2021 (N)"
gen study_id = "de2021-GLES-N"

save "de2021_gles_parmest_national_meta_F.dta", replace

* GERMANY 2021 (DISTRICT)

use "de2021_gles_parmest_district.dta", clear

gen region_code = 6
gen election_year = 2021
gen study_code = "Germany, GLES-DE 2021 (D)"
gen study_id = "de2021-GLES-D"

save "de2021_gles_parmest_district_meta_F.dta", replace

* HESSE 2013 (REGIONAL)

use "he2013_gles_parmest_regional.dta", clear

gen region_code = 7
gen election_year = 2013
gen study_code = "Germany, GLES-HE 2013 (R)"
gen study_id = "he2013-GLES-R"

save "he2013_gles_parmest_regional_meta_F.dta", replace

* GREAT BRITAIN 1964 (NATIONAL)

use "gb1964_bes_parmest_national_full.dta", clear

gen region_code = 8
gen election_year = 1964
gen study_code = "Great Britain, BES 1964 (N)"
gen study_id = "gb1964-BES-N"

save "gb1964_bes_parmest_national_meta_F.dta", replace

* GREAT BRITAIN 1964 (DISTRICT)

use "gb1964_bes_parmest_district_full.dta", clear

gen region_code = 8
gen election_year = 1964
gen study_code = "Great Britain, BES 1964 (D)"
gen study_id = "gb1964-BES-D"

save "gb1964_bes_parmest_district_meta_F.dta", replace

* GREAT BRITAIN 1987 (NATIONAL)

use "gb1987_bes_parmest_national_full.dta", clear

gen region_code = 8
gen election_year = 1987
gen study_code = "Great Britain, BES 1987 (N)"
gen study_id = "gb1987-BES-N"

save "gb1987_bes_parmest_national_meta_F.dta", replace

* GREAT BRITAIN 2005 (NATIONAL)

use "gb2005_bes_parmest_national_full.dta", clear

gen region_code = 8
gen election_year = 2005
gen study_code = "Great Britain, BES 2005 (N)"
gen study_id = "gb2005-BES-N"

save "gb2005_bes_parmest_national_meta_F.dta", replace

* GREAT BRITAIN 2005 (DISTRICT)

use "gb2005_bes_parmest_district_full.dta", clear

gen region_code = 8
gen election_year = 2005
gen study_code = "Great Britain, BES 2005 (D)"
gen study_id = "gb2005-BES-D"

save "gb2005_bes_parmest_district_meta_F.dta", replace

* GREAT BRITAIN 2010 (NATIONAL)

use "gb2010_bes_parmest_national_full.dta", clear

gen region_code = 8
gen election_year = 2010
gen study_code = "Great Britain, BES 2010 (N)"
gen study_id = "gb2010-BES-N"

save "gb2010_bes_parmest_national_meta_F.dta", replace

* GREAT BRITAIN 2010 (DISTRICT)

use "gb2010_bes_parmest_district_full.dta", clear

gen region_code = 8
gen election_year = 2010
gen study_code = "Great Britain, BES 2010 (D)"
gen study_id = "gb2010-BES-D"

save "gb2010_bes_parmest_district_meta_F.dta", replace

* GREAT BRITAIN 2015 (DISTRICT)

use "gb2015_bes_parmest_district_full.dta", clear

gen region_code = 8
gen election_year = 2015
gen study_code = "Great Britain, BES 2015 (D)"
gen study_id = "gb2015-BES-D"

save "gb2015_bes_parmest_district_meta_F.dta", replace

* GREAT BRITAIN 2017 (DISTRICT)

use "gb2017_bes_parmest_district_full.dta", clear

gen region_code = 8
gen election_year = 2017
gen study_code = "Great Britain, BES 2017 (D)"
gen study_id = "gb2017-BES-D"

save "gb2017_bes_parmest_district_meta_F.dta", replace

* GREAT BRITAIN 2019 (DISTRICT)

use "gb2019_bes_parmest_district_full.dta", clear

gen region_code = 8
gen election_year = 2019
gen study_code = "Great Britain, BES 2019 (D)"
gen study_id = "gb2019-BES-D"

save "gb2019_bes_parmest_district_meta_F.dta", replace

* ISRAEL 1992 (NATIONAL)

use "il1992_ines_parmest_national.dta", clear

gen region_code = 9
gen election_year = 1992
gen study_code = "Israel, INES 1992 (N)"
gen study_id = "il1992-INES-N"

save "il1992_ines_parmest_national_meta_F.dta", replace

* ISRAEL 1996 (NATIONAL #1)

use "il1996_ines_parmest_national_largest.dta", clear

gen region_code = 9
gen election_year = 1996
gen study_code = "Israel, INES 1996 #1 (N)"
gen study_id = "il1996-INES-N1"

save "il1996_ines_parmest_national_largest_meta_F.dta", replace

* ISRAEL 1996 (NATIONAL #2)

use "il1996_ines_parmest_national_pm.dta", clear

gen region_code = 9
gen election_year = 1996
gen study_code = "Israel, INES 1996 #2 (N)"
gen study_id = "il1996-INES-N2"

save "il1996_ines_parmest_national_pm_meta_F.dta", replace

* ISRAEL 2003 (NATIONAL)

use "il2003_ines_parmest_national.dta", clear

gen region_code = 9
gen election_year = 2003
gen study_code = "Israel, INES 2003 (N)"
gen study_id = "il2003-INES-N"

save "il2003_ines_parmest_national_meta_F.dta", replace

* ISRAEL 2009 (NATIONAL)

use "il2009_ines_parmest_national.dta", clear

gen region_code = 9
gen election_year = 2009
gen study_code = "Israel, INES 2009 (N)"
gen study_id = "il2009-INES-N"

save "il2009_ines_parmest_national_meta_F.dta", replace

* ISRAEL 2015 (NATIONAL)

use "il2015_ines_parmest_national.dta", clear

gen region_code = 9
gen election_year = 2015
gen study_code = "Israel, INES 2015 (N)"
gen study_id = "il2015-INES-N"

save "il2015_ines_parmest_national_meta_F.dta", replace

* ISRAEL 2020 (NATIONAL)

use "il2020_ines_parmest_national.dta", clear

gen region_code = 9
gen election_year = 2020
gen study_code = "Israel, INES 2020 (N)"
gen study_id = "il2020-INES-N"

save "il2020_ines_parmest_national_meta_F.dta", replace

* ISRAEL 2021 (NATIONAL)

use "il2021_ines_parmest_national.dta", clear

gen region_code = 9
gen election_year = 2021
gen study_code = "Israel, INES 2021 (N)"
gen study_id = "il2021-INES-N"

save "il2021_ines_parmest_national_meta_F.dta", replace

* ITALY 2006 (NATIONAL)

use "it2006_itanes_parmest_national.dta", clear

gen region_code = 10
gen election_year = 2006
gen study_code = "Italy, ITANES 2006 (N)"
gen study_id = "it2006-ITANES-N"

save "it2006_itanes_parmest_national_meta_F.dta", replace

* LOWER SAXONY 2013 (REGIONAL)

use "ni2013_gles_parmest_regional.dta", clear

gen region_code = 11
gen election_year = 2013
gen study_code = "Germany, GLES-NI 2013 (R)"
gen study_id = "ni2013-GLES-R"

save "ni2013_gles_parmest_regional_meta_F.dta", replace

* MECKLENBURG-VORPOMMERN 2016 (REGIONAL)

use "mv2016_gles_parmest_regional.dta", clear

gen region_code = 12
gen election_year = 2016
gen study_code = "Germany, GLES-MV 2016 (R)"
gen study_id = "mv2016-GLES-R"

save "mv2016_gles_parmest_regional_meta_F.dta", replace

* MONTREAL 2017 (MUNICIPAL)

use "mtl2017_cmes_parmest_municipal.dta", clear

gen region_code = 13
gen election_year = 2017
gen study_code = "Canada, CMES-MTL 2017 (M)"
gen study_id = "mtl2017-CMES-M"

save "mtl2017_cmes_parmest_municipal_meta_F.dta", replace

* NEW ZEALAND 2002 (NATIONAL)

use "nz2002_nzes_parmest_national.dta", clear

gen region_code = 14
gen election_year = 2002
gen study_code = "New Zealand, NZES 2002 (N)"
gen study_id = "nz2002-NZES-N"

save "nz2002_nzes_parmest_national_meta_F.dta", replace

* NEW ZEALAND 2002 (DISTRICT)

use "nz2002_nzes_parmest_district.dta", clear

gen region_code = 14
gen election_year = 2002
gen study_code = "New Zealand, NZES 2002 (D)"
gen study_id = "nz2002-NZES-D"

save "nz2002_nzes_parmest_district_meta_F.dta", replace

* NORTH RHINE-WESTPHALIA 2012 (REGIONAL)

use "nw2012_gles_parmest_regional.dta", clear

gen region_code = 14
gen election_year = 2012
gen study_code = "Germany, GLES-NW 2012 (R)"
gen study_id = "nw2012-GLES-R"

save "nw2012_gles_parmest_regional_meta_F.dta", replace

* NORTH RHINE-WESTPHALIA 2017 (REGIONAL)

use "nw2017_gles_parmest_regional.dta", clear

gen region_code = 15
gen election_year = 2017
gen study_code = "Germany, GLES-NW 2017 (R)"
gen study_id = "nw2017-GLES-R"

save "nw2017_gles_parmest_regional_meta_F.dta", replace

* ONTARIO 2003 (REGIONAL)

use "on2003_oes_parmest_provincial.dta", clear

gen region_code = 16
gen election_year = 2003
gen study_code = "Canada, OES 2003 (R)"
gen study_id = "on2003-OES-R"

save "on2003_oes_parmest_provincial_meta_F.dta", replace

* ONTARIO 2003 (DISTRICT)

use "on2003_oes_parmest_district.dta", clear

gen region_code = 16
gen election_year = 2003
gen study_code = "Canada, OES 2003 (D)"
gen study_id = "on2003-OES-D"

save "on2003_oes_parmest_district_meta_F.dta", replace

* ONTARIO 2007 (REGIONAL)

use "on2007_oes_parmest_provincial.dta", clear

gen region_code = 16
gen election_year = 2007
gen study_code = "Canada, OES 2007 (R)"
gen study_id = "on2007-OES-R"

save "on2007_oes_parmest_provincial_meta_F.dta", replace

* ONTARIO 2011 (REGIONAL)

use "on2011_ipsos_parmest_provincial_full.dta", clear

gen region_code = 16
gen election_year = 2011
gen study_code = "Canada, Ipsos-ON 2011 (R)"
gen study_id = "on2011-Ipsos-R"

save "on2011_ipsos_parmest_provincial_meta_F.dta", replace

* ONTARIO 2011 (DISTRICT)

use "on2011_ipsos_parmest_district_full.dta", clear

gen region_code = 16
gen election_year = 2011
gen study_code = "Canada, Ipsos-ON 2011 (D)"
gen study_id = "on2011-Ipsos-D"

save "on2011_ipsos_parmest_district_meta_F.dta", replace

* ONTARIO 2014 (REGIONAL)

use "on2014_ipsos_parmest_provincial_full.dta", clear

gen region_code = 16
gen election_year = 2014
gen study_code = "Canada, Ipsos-ON 2014 (R)"
gen study_id = "on2014-Ipsos-R"

save "on2014_ipsos_parmest_provincial_meta_F.dta", replace

* ONTARIO 2014 (DISTRICT)

use "on2014_ipsos_parmest_district_full.dta", clear

gen region_code = 16
gen election_year = 2014
gen study_code = "Canada, Ipsos-ON 2014 (D)"
gen study_id = "on2014-Ipsos-D"

save "on2014_ipsos_parmest_district_meta_F.dta", replace

* PORTUGAL 2009 (NATIONAL #1)

use "pt2009_pvs_parmest_national_morevotes.dta", clear

gen region_code = 17
gen election_year = 2009
gen study_code = "Portugal, PVS 2008 #1 (N)"
gen study_id = "pt2009-PVS-N1"

save "pt2009_pvs_parmest_national_morevotes_meta_F.dta", replace

* PORTUGAL 2009 (NATIONAL #2)

use "pt2009_pvs_parmest_national_majority.dta", clear

gen region_code = 17
gen election_year = 2009
gen study_code = "Portugal, PVS 2008 #2 (N)"
gen study_id = "pt2009-PVS-N2"

save "pt2009_pvs_parmest_national_majority_meta_F.dta", replace

* QUEBEC 2017 (MUNICIPAL)

use "qc2017_cmes_parmest_municipal.dta", clear

gen region_code = 18
gen election_year = 2017
gen study_code = "Canada, CMES-QC 2017 (M)"
gen study_id = "qc2017-CMES-M"

save "qc2017_cmes_parmest_municipal_meta_F.dta", replace

* RHINELAND-PALATINATE 2016 (REGIONAL)

use "rp2016_gles_parmest_regional.dta", clear

gen region_code = 19
gen election_year = 2016
gen study_code = "Germany, GLES-RP 2016 (R)"
gen study_id = "rp2016-GLES-R"

save "rp2016_gles_parmest_regional_meta_F.dta", replace

* SASKATCHEWAN 2020 (REGIONAL)

use "sk2020_skpes_parmest_provincial.dta", clear

gen region_code = 20
gen election_year = 2020
gen study_code = "Canada, SKPES 2020 (R)"
gen study_id = "sk2020-SKPES-R"

save "sk2020_skpes_parmest_provincial_meta_F.dta", replace

* SAXONY 2014 (REGIONAL)

use "sn2014_gles_parmest_regional.dta", clear

gen region_code = 21
gen election_year = 2014
gen study_code = "Germany, GLES-SN 2014 (R)"
gen study_id = "sn2014-GLES-R"

save "sn2014_gles_parmest_regional_meta_F.dta", replace

* SCHLESWIG-HOLSTEIN 2017 (REGIONAL)

use "sh2017_gles_parmest_regional.dta", clear

gen region_code = 22
gen election_year = 2017
gen study_code = "Germany, GLES-SH 2017 (R)"
gen study_id = "sh2017-GLES-R"

save "sh2017_gles_parmest_regional_meta_F.dta", replace

* SPAIN 2016 (NATIONAL)

use "es2016_cis_parmest_national_full.dta", clear

gen region_code = 23
gen election_year = 2016
gen study_code = "Spain, CIS 2016 (N)"
gen study_id = "es2016-CIS-N"

save "es2016_cis_parmest_national_meta_F.dta", replace

* SPAIN MARCH 2019 (NATIONAL)

use "esA2019_cis_parmest_national_full.dta", clear

gen region_code = 23
gen election_year = 2019
gen study_code = "Spain, CIS Apr2019 (N)"
gen study_id = "esA2019-CIS-N"

save "esA2019_cis_parmest_national_meta_F.dta", replace

* SPAIN NOVEMBER 2019 (NATIONAL)

use "esN2019_cis_parmest_national_full.dta", clear

gen region_code = 23
gen election_year = 2019
gen study_code = "Spain, CIS Nov2019 (N)"
gen study_id = "esN2019-CIS-N"

save "esN2019_cis_parmest_national_meta_F.dta", replace

* THURINGIA 2014 (REGIONAL)

use "th2014_gles_parmest_regional.dta", clear

gen region_code = 24
gen election_year = 2014
gen study_code = "Germany, GLES-TH 2014 (R)"
gen study_id = "th2014-GLES-R"

save "th2014_gles_parmest_regional_meta_F.dta", replace

* UNITED STATES 1984 (NATIONAL)

use "us1984_anes_parmest_national.dta", clear

gen region_code = 25
gen election_year = 1984
gen study_code = "United States, ANES 1984 (N)"
gen study_id = "us1984-ANES-N"

save "us1984_anes_parmest_national_meta_F.dta", replace

* UNITED STATES 1984 (STATE)

use "us1984_anes_parmest_state.dta", clear

gen region_code = 25
gen election_year = 1984
gen study_code = "United States, ANES 1984 (S)"
gen study_id = "us1984-ANES-S"

save "us1984_anes_parmest_state_meta_F.dta", replace

* UNITED STATES 1988 (NATIONAL)

use "us1988_anes_parmest_national.dta", clear

gen region_code = 25
gen election_year = 1988
gen study_code = "United States, ANES 1988 (N)"
gen study_id = "us1988-ANES-N"

save "us1988_anes_parmest_national_meta_F.dta", replace

* UNITED STATES 1988 (STATE)

use "us1988_anes_parmest_state.dta", clear

gen region_code = 25
gen election_year = 1988
gen study_code = "United States, ANES 1988 (S)"
gen study_id = "us1988-ANES-S"

save "us1988_anes_parmest_state_meta_F.dta", replace

* UNITED STATES 1992 (NATIONAL)

use "us1992_anes_parmest_national.dta", clear

gen region_code = 25
gen election_year = 1992
gen study_code = "United States, ANES 1992 (N)"
gen study_id = "us1992-ANES-N"

save "us1992_anes_parmest_national_meta_F.dta", replace

* UNITED STATES 1992 (STATE)

use "us1992_anes_parmest_state.dta", clear

gen region_code = 25
gen election_year = 1992
gen study_code = "United States, ANES 1992 (S)"
gen study_id = "us1992-ANES-S"

save "us1992_anes_parmest_state_meta_F.dta", replace

* UNITED STATES 1996 (NATIONAL)

use "us1996_anes_parmest_national.dta", clear

gen region_code = 25
gen election_year = 1996
gen study_code = "United States, ANES 1996 (N)"
gen study_id = "us1996-ANES-N"

save "us1996_anes_parmest_national_meta_F.dta", replace

* UNITED STATES 1996 (STATE)

use "us1996_anes_parmest_state.dta", clear

gen region_code = 25
gen election_year = 1996
gen study_code = "United States, ANES 1996 (S)"
gen study_id = "us1996-ANES-S"

save "us1996_anes_parmest_state_meta_F.dta", replace

* UNITED STATES 2000 (NATIONAL)

use "us2000_anes_parmest_national.dta", clear

gen region_code = 25
gen election_year = 2000
gen study_code = "United States, ANES 2000 (PR-N)"
gen study_id = "us2000-ANES-N"

save "us2000_anes_parmest_national_meta_F.dta", replace

* UNITED STATES 2000 (HOUSE)

use "us2000_anes_parmest_house.dta", clear

gen region_code = 25
gen election_year = 2000
gen study_code = "United States, ANES 2000 (HS-N)"
gen study_id = "us2000-ANES-USH"

save "us2000_anes_parmest_house_meta_F.dta", replace

* UNITED STATES 2000 (SENATE)

use "us2000_anes_parmest_senate.dta", clear

gen region_code = 25
gen election_year = 2000
gen study_code = "United States, ANES 2000 (SN-N)"
gen study_id = "us2000-ANES-USS"

save "us2000_anes_parmest_senate_meta_F.dta", replace

* UNITED STATES 2000 (NATIONAL)

use "us2000_naes_parmest_national_full.dta", clear

gen region_code = 25
gen election_year = 2000
gen study_code = "United States, NAES 2000 (N)"
gen study_id = "us2000-NAES-N"

save "us2000_naes_parmest_national_meta_F.dta", replace

* UNITED STATES 2000 (DEMOCRATIC PRIMARIES)

use "us2000_naes_parmest_demprimaries_full.dta", clear

gen region_code = 25
gen election_year = 2000
gen study_code = "United States, NAES 2000 (DEM-P)"
gen study_id = "us2000-NAES-DEM-P"

save "us2000_naes_parmest_demprimaries_meta_F.dta", replace

* UNITED STATES 2000 (REPUBLICAN PRIMARIES)

use "us2000_naes_parmest_repprimaries_full.dta", clear

gen region_code = 25
gen election_year = 2000
gen study_code = "United States, NAES 2000 (REP-P)"
gen study_id = "us2000-NAES-REP-P"

save "us2000_naes_parmest_repprimaries_meta_F.dta", replace

* UNITED STATES 2004 (NATIONAL)

use "us2004_anes_parmest_national.dta", clear

gen region_code = 25
gen election_year = 2004
gen study_code = "United States, ANES 2004 (N)"
gen study_id = "us2004-ANES-N"

save "us2004_anes_parmest_national_meta_F.dta", replace

* UNITED STATES 2004 (STATE)

use "us2004_anes_parmest_state.dta", clear

gen region_code = 25
gen election_year = 2004
gen study_code = "United States, ANES 2004 (S)"
gen study_id = "us2004-ANES-S"

save "us2004_anes_parmest_state_meta_F.dta", replace

* UNITED STATES 2004 (NATIONAL)

use "us2000_naes_parmest_national_full.dta", clear

gen region_code = 25
gen election_year = 2004
gen study_code = "United States, NAES 2004 (N)"
gen study_id = "us2004-NAES-N"

save "us2004_naes_parmest_national_meta_F.dta", replace

* UNITED STATES 2004 (DEMOCRATIC PRIMARIES)

use "us2000_naes_parmest_demprimaries_full.dta", clear

gen region_code = 25
gen election_year = 2004
gen study_code = "United States, NAES 2004 (DEM-P)"
gen study_id = "us2004-NAES-DEM-P"

save "us2004_naes_parmest_demprimaries_meta_F.dta", replace

* UNITED STATES 2008 (NATIONAL)

use "us2008_anes_parmest_national.dta", clear

gen region_code = 25
gen election_year = 2008
gen study_code = "United States, ANES 2008 (N)"
gen study_id = "us2008-ANES-N"

save "us2008_anes_parmest_national_meta_F.dta", replace

* UNITED STATES 2008 (STATE)

use "us2008_anes_parmest_state.dta", clear

gen region_code = 25
gen election_year = 2008
gen study_code = "United States, ANES 2008 (S)"
gen study_id = "us2008-ANES-S"

save "us2008_anes_parmest_state_meta_F.dta", replace

* UNITED STATES 2008 (NATIONAL)

use "us2008_naes_parmest_national_full.dta", clear

gen region_code = 25
gen election_year = 2008
gen study_code = "United States, NAES 2008 (N)"
gen study_id = "us2008-NAES-N"

save "us2008_naes_parmest_national_meta_F.dta", replace

* UNITED STATES 2008 (DEMOCRATIC PRIMARIES)

use "us2008_naes_parmest_demprimaries_full.dta", clear

gen region_code = 25
gen election_year = 2008
gen study_code = "United States, NAES 2008 (DEM-P)"
gen study_id = "us2008-NAES-DEM-P"

save "us2008_naes_parmest_demprimaries_meta_F.dta", replace

* UNITED STATES 2008 (REPUBLICAN PRIMARIES)

use "us2008_naes_parmest_repprimaries_full.dta", clear

gen region_code = 25
gen election_year = 2008
gen study_code = "United States, NAES 2008 (REP-P)"
gen study_id = "us2008-NAES-REP-P"

save "us2008_naes_parmest_repprimaries_meta_F.dta", replace

* UNITED STATES 2012 (NATIONAL)

use "us2012_anes_parmest_national_full.dta", clear

gen region_code = 25
gen election_year = 2012
gen study_code = "United States, ANES 2012 (N)"
gen study_id = "us2012-ANES-N"

save "us2012_anes_parmest_national_meta_F.dta", replace

* UNITED STATES 2012 (STATE)

use "us2012_anes_parmest_state_full.dta", clear

gen region_code = 25
gen election_year = 2012
gen study_code = "United States, ANES 2012 (S)"
gen study_id = "us2012-ANES-S"

save "us2012_anes_parmest_state_meta_F.dta", replace

* UNITED STATES 2016 (NATIONAL)

use "us2016_anes_parmest_national_full.dta", clear

gen region_code = 25
gen election_year = 2016
gen study_code = "United States, ANES 2016 (N)"
gen study_id = "us2016-ANES-N"

save "us2016_anes_parmest_national_meta_F.dta", replace

* UNITED STATES 2016 (STATE)

use "us2016_anes_parmest_state_full.dta", clear

gen region_code = 25
gen election_year = 2016
gen study_code = "United States, ANES 2016 (S)"
gen study_id = "us2016-ANES-S"

save "us2016_anes_parmest_state_meta_F.dta", replace

* UNITED STATES 2016 (NATIONAL)

use "us2016_taps_parmest_national_full.dta", clear

gen region_code = 25
gen election_year = 2016
gen study_code = "United States, TAPS 2016 (N)"
gen study_id = "us2016-TAPS-N"

save "us2016_taps_parmest_national_meta_F.dta", replace

* UNITED STATES 2016 (DEMOCRATIC PRIMARIES)

use "us2016_taps_parmest_demprimaries_full.dta", clear

gen region_code = 25
gen election_year = 2016
gen study_code = "United States, TAPS 2016 (DEM-P)"
gen study_id = "us2016-TAPS-DEM-P"

save "us2016_taps_parmest_demprimaries_meta_F.dta", replace

* UNITED STATES 2016 (REPUBLICAN PRIMARIES)

use "us2016_taps_parmest_repprimaries_full.dta", clear

gen region_code = 25
gen election_year = 2016
gen study_code = "United States, TAPS 2016 (REP-P)"
gen study_id = "us2016-TAPS-REP-P"

save "us2016_taps_parmest_repprimaries_meta_F.dta", replace

* UNITED STATES 2016 (NATIONAL)

use "us2016_uas_parmest_national_full.dta", clear

gen region_code = 25
gen election_year = 2016
gen study_code = "United States, UAS 2016 (N)"
gen study_id = "us2016-UAS-N"

save "us2016_uas_parmest_national_meta_F.dta", replace

* UNITED STATES 2020 (NATIONAL)

use "us2020_anes_parmest_national_full.dta", clear

gen region_code = 25
gen election_year = 2020
gen study_code = "United States, ANES 2020 (N)"
gen study_id = "us2020-ANES-N"

save "us2020_anes_parmest_national_meta_F.dta", replace

* UNITED STATES 2020 (STATE)

use "us2020_anes_parmest_state_full.dta", clear

gen region_code = 25
gen election_year = 2020
gen study_code = "United States, ANES 2020 (S)"
gen study_id = "us2020-ANES-S"

save "us2020_anes_parmest_state_meta_F.dta", replace

* New file: meta_contact_networks

use "at2013_autnes_parmest_national_meta_F.dta", clear

append using at2017_autnes_parmest_national_meta_F bw2016_gles_parmest_regional_meta_F by2013_gles_parmest_regional_meta_F bb2014_gles_parmest_regional_meta_F ca1988_ces_parmest_national_meta_F ca1988_ces_parmest_district_meta_F ca1993_ces_parmest_national_meta_F ca1997_ces_parmest_national_meta_F ca2000_ces_parmest_district_meta_F ca2004_ces_parmest_national_meta_F ca2004_ces_parmest_district_meta_F ca2006_ces_parmest_national_meta_F ca2006_ces_parmest_district_meta_F ca2008_ces_parmest_national_meta_F ca2008_ces_parmest_district_meta_F ca2011_ces_parmest_national_meta_F ca2011_ces_parmest_district_meta_F ca2019_ces_parmest_mostseats_meta_F ca2019_ces_parmest_majority_meta_F ca2019_ces_parmest_district_meta_F ca2011_ipsos_parmest_national_meta_F ca2011_ipsos_parmest_district_meta_F ca2015_ipsos_parmest_national_meta_F ca2015_ipsos_parmest_district_meta_F de2002_gfes_parmest_national_meta_F de2009_gles_parmest_national_meta_F de2009_gles_parmest_district_meta_F de2013_gles_parmest_national_meta_F de2013_gles_parmest_district_meta_F de2017_gles_parmest_national_meta_F de2017_gles_parmest_district_meta_F de2021_gles_parmest_national_meta_F de2021_gles_parmest_district_meta_F gb1964_bes_parmest_national_meta_F gb1964_bes_parmest_district_meta_F gb1987_bes_parmest_national_meta_F gb2005_bes_parmest_national_meta_F gb2005_bes_parmest_district_meta_F gb2010_bes_parmest_national_meta_F gb2010_bes_parmest_district_meta_F gb2015_bes_parmest_district_meta_F gb2017_bes_parmest_district_meta_F gb2019_bes_parmest_district_meta_F  he2013_gles_parmest_regional_meta_F it2006_itanes_parmest_national_meta_F il1992_ines_parmest_national_meta_F il1996_ines_parmest_national_largest_meta_F il1996_ines_parmest_national_pm_meta_F il2003_ines_parmest_national_meta_F il2009_ines_parmest_national_meta_F il2015_ines_parmest_national_meta_F il2020_ines_parmest_national_meta_F il2021_ines_parmest_national_meta_F ni2013_gles_parmest_regional_meta_F mtl2017_cmes_parmest_municipal_meta_F mv2016_gles_parmest_regional_meta_F nz2002_nzes_parmest_national_meta_F nz2002_nzes_parmest_district_meta_F nw2012_gles_parmest_regional_meta_F nw2017_gles_parmest_regional_meta_F on2003_oes_parmest_provincial_meta_F on2003_oes_parmest_district_meta_F on2007_oes_parmest_provincial_meta_F on2011_ipsos_parmest_provincial_meta_F on2011_ipsos_parmest_district_meta_F on2014_ipsos_parmest_provincial_meta_F on2014_ipsos_parmest_district_meta_F pt2009_pvs_parmest_national_morevotes_meta_F pt2009_pvs_parmest_national_majority_meta_F qc2017_cmes_parmest_municipal_meta_F sn2014_gles_parmest_regional_meta_F rp2016_gles_parmest_regional_meta_F sh2017_gles_parmest_regional_meta_F es2016_cis_parmest_national_meta_F esA2019_cis_parmest_national_meta_F esN2019_cis_parmest_national_meta_F sk2020_skpes_parmest_provincial_meta_F th2014_gles_parmest_regional_meta_F us1984_anes_parmest_national_meta_F us1984_anes_parmest_state_meta_F us1988_anes_parmest_national_meta_F us1988_anes_parmest_state_meta_F us1992_anes_parmest_national_meta_F us1992_anes_parmest_state_meta_F us1996_anes_parmest_national_meta_F us1996_anes_parmest_state_meta_F us2000_anes_parmest_national_meta_F us2000_anes_parmest_house_meta_F us2000_anes_parmest_senate_meta_F us2000_naes_parmest_national_meta_F us2000_naes_parmest_demprimaries_meta_F us2000_naes_parmest_repprimaries_meta_F us2004_anes_parmest_national_meta_F us2004_anes_parmest_state_meta_F us2004_naes_parmest_national_meta_F us2004_naes_parmest_demprimaries_meta_F us2008_anes_parmest_national_meta_F us2008_anes_parmest_state_meta_F us2008_naes_parmest_national_meta_F us2008_naes_parmest_demprimaries_meta_F us2008_naes_parmest_repprimaries_meta_F us2012_anes_parmest_national_meta_F us2012_anes_parmest_state_meta_F us2016_anes_parmest_national_meta_F us2016_anes_parmest_state_meta_F us2016_taps_parmest_national_meta_F us2016_taps_parmest_demprimaries_meta_F us2016_taps_parmest_repprimaries_meta_F us2016_uas_parmest_national_meta_F us2020_anes_parmest_national_meta_F us2020_anes_parmest_state_meta_F

label define region_code 1 "Austria" 2 "Baden-Württemberg" 3 "Bavaria" 4 "Brandenburg" 5 "Canada" 6 "Germany" 7 "Hesse" 8 "Great Britain" 9 "Israel" 10 "Italy" 11 "Lower Saxony" 12 "Mecklenburg-Vorpommern" 13 "Montreal" 14 "New Zealand" 15 "North-Rhine Westphalia" 16 "Ontario" 17 "Portugal" 18 "Quebec" 19 "Rhineland-Palatinate" 20 "Saskatchewan" 21 "Saxony" 22 "Schleswig-Holstein" 23 "Spain" 24 "Thuringia" 25 "United States"
label values region_code region_code

gen e_discussion = estimate if parm == "discussion" | parm == "1.discussion"
gen e_disagreement = estimate if parm == "disagreement"
gen e_size = estimate if parm == "size"
gen e_expertise = estimate if parm == "expertise"
gen e_wishful = estimate if parm == "wishful"
gen e_interest = estimate if parm == "interest"
gen e_education = estimate if parm == "education"
gen e_reelected = estimate if parm == "1.reelected"
gen e_margin = estimate if parm == "margin"

gen se_discussion = stderr if parm == "discussion" | parm == "1.discussion"
gen se_disagreement = stderr if parm == "disagreement"
gen se_size = stderr if parm == "size"
gen se_expertise = stderr if parm == "expertise"
gen se_wishful = stderr if parm == "wishful"
gen se_interest = stderr if parm == "interest"
gen se_education = stderr if parm == "education"
gen se_reelected = stderr if parm == "1.reelected"
gen se_margin = stderr if parm == "margin"

gen lci_discussion = min95 if parm == "discussion" | parm == "1.discussion"
gen lci_disagreement = min95 if parm == "disagreement"
gen lci_size = min95 if parm == "size"
gen lci_expertise = min95 if parm == "expertise"
gen lci_wishful = min95 if parm == "wishful"
gen lci_interest = min95 if parm == "interest"
gen lci_education = min95 if parm == "education"
gen lci_reelected = min95 if parm == "1.reelected"
gen lci_margin = min95 if parm == "margin"

gen uci_discussion = max95 if parm == "discussion" | parm == "1.discussion"
gen uci_disagreement = max95 if parm == "disagreement"
gen uci_size = max95 if parm == "size"
gen uci_expertise = max95 if parm == "expertise"
gen uci_interest = max95 if parm == "wishful" | parm == "1.wishful"
gen uci_wishful = max95 if parm == "interest"
gen uci_education = max95 if parm == "education"
gen uci_reelected = max95 if parm == "1.reelected"
gen uci_margin = max95 if parm == "margin"

save "meta_contact_networks_F.dta", replace

* Correct forecasts by election study

merge m:1 study_id using percent_correct, keepusing(percent_correct)

* Success rates

gen discussion_successes = 1 if p < 0.05 & estimate > 0 & parm == "discussion" | p < 0.05 & estimate > 0 & parm == "1.discussion"
tab discussion_successes
gen discussion_failures = 1 if p >= 0.05 & parm == "discussion" | p >= 0.05 & parm == "1.discussion"
tab discussion_failures
gen discussion_anomalies = 1 if p < 0.05 & estimate < 0 & parm == "discussion" | p < 0.05 & estimate < 0 & parm == "1.discussion"
tab discussion_anomalies
tab parm if parm == "discussion" | parm == "1.discussion"

gen disagreement_successes = 1 if p < 0.05 & estimate > 0 & parm == "disagreement" 
tab disagreement_successes
gen disagreement_failures = 1 if p >= 0.05 & parm == "disagreement"
tab disagreement_failures
gen disagreement_anomalies = 1 if p < 0.05 & estimate < 0 & parm == "disagreement" 
tab disagreement_anomalies
tab parm if parm == "disagreement"

gen size_successes = 1 if p < 0.05 & estimate > 0 & parm == "size"
tab size_successes
gen size_failures = 1 if p >= 0.05 & parm == "size" 
tab size_failures
gen size_anomalies = 1 if p < 0.05 & estimate < 0 & parm == "size"
tab size_anomalies
tab parm if parm == "size"

gen expertise_successes = 1 if p < 0.05 & estimate > 0 & parm == "expertise" 
tab expertise_successes
gen expertise_failures = 1 if p >= 0.05 & parm == "expertise" 
tab expertise_failures
gen expertise_anomalies = 1 if p < 0.05 & estimate < 0 & parm == "expertise" 
tab expertise_anomalies
tab parm if parm == "expertise"

gen wishful_successes = 1 if p < 0.05 & estimate > 0 & parm == "wishful" | p < 0.05 & estimate > 0 & parm == "1.wishful"
tab wishful_successes
gen wishful_failures = 1 if p >= 0.05 & parm == "wishful" | p >= 0.05 & parm == "1.wishful"
tab wishful_failures
gen wishful_anomalies = 1 if p < 0.05 & estimate < 0 & parm == "wishful" | p < 0.05 & estimate < 0 & parm == "1.wishful"
tab wishful_anomalies
tab parm if parm == "wishful" | parm == "1.wishful"

gen interest_successes = 1 if p < 0.05 & estimate > 0 & parm == "interest"
tab interest_successes
gen interest_failures = 1 if p >= 0.05 & parm == "interest"
tab interest_failures
gen interest_anomalies = 1 if p < 0.05 & estimate < 0 & parm == "interest"
tab interest_anomalies
tab parm if parm == "interest" & study_id!="ca1988-CES-N"

gen education_successes = 1 if p < 0.05 & estimate > 0 & parm == "education"
tab education_successes
gen education_failures = 1 if p >= 0.05 & parm == "education"
tab education_failures
gen education_anomalies = 1 if p < 0.05 & estimate < 0 & parm == "education"
tab education_anomalies
tab parm if parm == "education"

gen news_successes = 1 if p < 0.05 & estimate > 0 & parm == "news" | p < 0.05 & estimate > 0 & parm == "1.primattention"
tab news_successes
gen news_failures = 1 if p >= 0.05 & parm == "news" | p >= 0.05 & parm == "1.primattention"
tab news_failures 
gen news_anomalies = 1 if p < 0.05 & estimate < 0 & parm == "news" | p < 0.05 & estimate < 0 & parm == "1.primattention"
tab news_anomalies
tab parm if parm == "news" | parm == "1.primattention"

gen knowledge_successes = 1 if p < 0.05 & estimate > 0 & parm == "knowledge"
tab knowledge_successes
gen knowledge_failures = 1 if p >= 0.05 & parm == "knowledge"
tab knowledge_failures
gen knowledge_anomalies = 1 if p < 0.05 & estimate < 0 & parm == "knowledge"
tab knowledge_anomalies
tab parm if parm == "knowledge"

gen time_successes = 1 if p < 0.05 & estimate > 0 & parm == "time"
tab time_successes
gen time_failures = 1 if p >= 0.05 & parm == "time"
tab time_failures
gen time_anomalies = 1 if p < 0.05 & estimate < 0 & parm == "time"
tab time_anomalies
tab parm if parm == "time"

gen reelected_successes = 1 if p < 0.05 & estimate > 0 & parm == "1.reelected"
tab reelected_successes
gen reelected_failures = 1 if p >= 0.05 & parm == "1.reelected"
tab reelected_failures
gen reelected_anomalies = 1 if p < 0.05 & estimate < 0 & parm == "1.reelected"
tab reelected_anomalies
tab parm if parm == "1.reelected"

gen margin_successes = 1 if p < 0.05 & estimate > 0 & parm == "margin"
tab margin_successes
gen margin_failures = 1 if p >= 0.05 & parm == "margin"
tab margin_failures
gen margin_anomalies = 1 if p < 0.05 & estimate < 0 & parm == "margin"
tab margin_anomalies
tab parm if parm == "margin"

sort study_code

* Meta-analysis: discussion

meta set e_discussion se_discussion, studylabel(study_code) eslabel(Odds ratio)

meta summarize

meta forestplot, nullrefline(lcolor(black)) ciopts(lcolor(black)) markeropts(mcolor(black)) insidemarker(mcolor(white)) omarkeropts(mcolor(black)) saving(discussion_full, replace)

* Meta-analysis: disagreement

meta set e_disagreement se_disagreement, studylabel(study_code) eslabel(Odds ratio)

meta summarize

meta forestplot, nullrefline(lcolor(black)) ciopts(lcolor(black)) markeropts(mcolor(black)) insidemarker(mcolor(white)) omarkeropts(mcolor(black)) saving(disagreement_full, replace)

* Meta-analysis: expertise

meta set e_expertise se_expertise, studylabel(study_code) eslabel(Odds ratio)

meta summarize

meta forestplot, nullrefline(lcolor(black)) ciopts(lcolor(black)) markeropts(mcolor(black)) insidemarker(mcolor(white)) omarkeropts(mcolor(black)) saving(expertise_full, replace)

* Meta-analysis: size

meta set e_size se_size, studylabel(study_code) eslabel(Odds ratio)

meta summarize

meta forestplot, nullrefline(lcolor(black)) ciopts(lcolor(black)) markeropts(mcolor(black)) insidemarker(mcolor(white)) omarkeropts(mcolor(black)) saving(size_full, replace)

* Meta-analysis: wishful thinking

meta set e_wishful se_wishful, studylabel(study_code) eslabel(Odds ratio)

meta summarize

meta forestplot, nullrefline(lcolor(black)) ciopts(lcolor(black)) markeropts(mcolor(black)) insidemarker(mcolor(white)) omarkeropts(mcolor(black)) saving(wishful_full, replace)

* Meta-analysis: interest

meta set e_interest se_interest, studylabel(study_code) eslabel(Odds ratio)

meta summarize

meta forestplot, nullrefline(lcolor(black)) ciopts(lcolor(black)) markeropts(mcolor(black)) insidemarker(mcolor(white)) omarkeropts(mcolor(black)) saving(interest_full, replace)

* Meta-analysis: education

meta set e_education se_education, studylabel(study_code) eslabel(Odds ratio)

meta summarize

meta forestplot, nullrefline(lcolor(black)) ciopts(lcolor(black)) markeropts(mcolor(black)) insidemarker(mcolor(white)) omarkeropts(mcolor(black)) saving(education_full, replace)

log close